#include "Utils.h"
#include "ListNode.h"
#include "TreeNode.h"
#include <iostream>
#include <vector>
#include <string>

using namespace std;

class Issue231 {
public:
	bool isPowerOfTwo(int n) {
		if (n<=0)
			return false;
		while(0==n%2)
			n=n/2;
		return n==1;
	}
};

int main231(){

	Issue231 sol;
	int n;
	while (true)
	{
		cin>>n;
		cout<<sol.isPowerOfTwo(n)<<endl;
	}

	return 0;
}